﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using ObjectSync;
using ObjectSync.Interfaces;
using TestModel;

namespace TestServer
{
    class Program
    {
        static void Main(string[] args)
        {
            //var t1 = new test1();
            ISyncable t1 = new test1();

            SyncManager.Instance.Register(ref t1);

            ISyncable t2= new test1();
            ((test1) t2).Prop2 = 2;

            SyncManager.Instance.Register(ref t2);

            NetworkManager.Instance.StartServer(17171);

            //((test1)t1).Prop1 = "Teste Servidor";
            //((test1)t1).Prop2 = 5;

            //((test1)t2).Prop2 = 6;

            while (true)
            {
                Console.WriteLine("O1 - Prop 1:" + ((test1)t1).Prop1);
                Console.WriteLine("O1 - Prop 2:" + ((test1)t1).Prop2);
                Console.WriteLine("O2 - Prop 1:" + ((test1)t2).Prop1);
                Console.WriteLine("O2 - Prop 2:" + ((test1)t2).Prop2);
                Thread.Sleep(3000);

            }


            //SyncManager.Instance.Syncronize();

        }
    }
}
